import {createStore, applyMiddleware} from 'redux'
import totalState from './reducers'
import createSagaMiddleware from 'redux-saga'
import todoSaga from './saga/todo.saga'

const sagaMiddleware = createSagaMiddleware()

const store = createStore(totalState, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(todoSaga)

export default store
/**
 * 当前模块完成 store 的创建 + 中间件的创建
 */